package com.String;

public class StringReversal {
    public static void main(String[] args) {
/*        StringBuffer a = new StringBuffer("abc");
        a.reverse();
        System.out.println(a);
        字符串反转，用StringBuffer的reverse（）方法很快*/

        String a = "abc";
        String result = "";
        for (int i = 0; i < a.length(); i++) {
            char c = a.charAt(i);
            result = c + result;  // 如果写成result + c 加出来的效果是不一样的
        }

        System.out.println(result);
    }

}
